import 'package:flutter/material.dart';

import 'package:ilive_ihome/model/theme.dart';
import 'package:ilive_ihome/model/router.dart';
import 'package:ilive_ihome/layout/main.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  Map<String, WidgetBuilder> _buildRouters() {
    return Map<String, WidgetBuilder>.fromIterable(routers,
        key: (dynamic page) => page.routeName,
        value: (dynamic page) => page.builder);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primaryColor: devColor.primary,
      ),
      routes: _buildRouters(),
      home: MainUI(),
    );
  }
}
